import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class AutoIncrementalChart extends Frame {

	private static JButton b1 = new JButton("b1");
	private static JButton b2 = new JButton("b2");
	
	int bc1;
	int bc2;

	public static void main(String[] args) {

		new AutoIncrementalChart();

	}

	public AutoIncrementalChart() {
		// TODO Auto-generated method stub
		JFrame fb = new JFrame("FinestraB");

		fb.setSize(500, 400);
		fb.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		fb.setVisible(true);

		JPanel b = new JPanel();
		fb.add(b);
		b.add(b1);
		b.add(b2);

		b1.addMouseListener(new MouseAdapter() {
			public void mouseClicked(MouseEvent e) {
				System.out.println("b1 clicked.");
				bc1++;
			}

		});
		b2.addMouseListener(new MouseAdapter() {
			public void mouseClicked(MouseEvent e) {
				System.out.println("b2 clicked.");
				bc2++;
				
			}

		});

	}
}
